package com.Interface;

import java.util.ArrayList;

public class StudentOperatorlmpl1 implements StudentOperator {
    @Override
    public void printAllInfo(ArrayList<Student> students) {
        System.out.println("------写生的全部信息如下----------");
        for (int i = 0; i <students.size() ; i++) {
            Student s= students.get(i);
            System.out.println("姓名"+s.getName()+"，性别"+s.getSex()+"，成绩"+s.getScore());

        }
        System.out.println("-----------------");
    }

    @Override
    public void printAllScore(ArrayList<Student> students) {
        double allScore=0.0;
        for (int i = 0; i <students.size() ; i++) {
            Student s=students.get(i);
            allScore+=s.getScore();

        }
        System.out.println("总分是"+allScore+"平均分是"+allScore/students.size());

    }
}
